SHELL		= /bin/sh
# use O=-O (usual) or O=-g (debugging)
O		= -g -Wall 
CC		= @CC@
CPPFLAGS	= @CPPFLAGS@
CFLAGS		= -I. $(CPPFLAGS) @CFLAGS@
LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

INCLUDES	= sb.h osdep.h db.h 
OBJECTS		= main.o logging.o chat.o db.o primordial.o events.o
BINARY		= ../bin/sbchat

all:	${BINARY} 

.c.o:	${INCLUDES}
	${CC} -c ${O} ${CFLAGS} $<

${BINARY}: ${INCLUDES} ${OBJECTS}
	-mv ${BINARY} ${BINARY}.old
	${CC} -o $@ ${CFLAGS} ${LDOPTS} ${OBJECTS} ${LIBDIRS} ${LIBS}

clean:  
	rm -f *.o
	rm -f *.?~

